// `include "adder16.v"
module add_tc_16_16(
    input  wire [15:0]  a   ,//输入数据，二进制补码
    input  wire [15:0]  b   ,//输入数据，二进制补码
    output wire [16:0]  sum  //输出和a + b，二进制补码
);

wire cin;
wire [15:0] out;
wire        cout;

adder16 u_adder16(
    .a    (a    ),
    .b    (b    ),
    .cin  (cin  ),
    .out  (out  ),
    .cout (cout )
);
assign cin = 0;
assign sum[15:0] = out;
// assign sum[16] = a[15]|b[15]|cout;
assign sum[16] = (~a[15]&~b[15]&cout)|(~a[15]&b[15]&~cout)|(a[15]&~b[15]&~cout)|(a[15]&b[15]&cout);

endmodule